package ljt.music.module.base;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.ljq.mvpframework.presenter.BaseMvpPresenter;
import com.ljq.mvpframework.view.AbstractFragment;
import com.ljq.mvpframework.view.BaseMvpView;

/**
 * @author jiangtao
 * @date 2017/11/25
 */

public abstract class BaseMvpFragment<V extends BaseMvpView, P extends BaseMvpPresenter<V>> extends AbstractFragment<V, P> {

    protected abstract int attachLayoutId();

    protected abstract void initView(View view);

    protected abstract void initData();

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        super.onCreateView(inflater, container, savedInstanceState);
        View view = inflater.inflate(attachLayoutId(), container, false);
        initView(view);
        initData();
        return view;
    }
}
